package com.hotel.service;

import com.hotel.entity.Menu;
import com.hotel.repository.MenuRepository;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("menuService")
public class MenuService {
    private final MenuRepository repository;
    public MenuService() {
        this.repository = new MenuRepository();
    }

    public void save(Menu menu) {
        repository.save(menu);
    }

    public List<Map<String, Object>> findAll() {
        return repository.findAll();
    }

    public void update(int id, Menu menu) {
        repository.update(id, menu);
    }

    public void delete(int id) {
        repository.delete(id);
    }
}
